package com.itheima.chapter09.io.properties;

import java.util.Properties;
import java.util.Set;

//特有方法
public class Demo2 {
    public static void main(String[] args) {
        Properties prop =new Properties();
        //添加键值对元素
        prop.setProperty("江苏","南京");
        prop.setProperty("辽宁","沈阳");
        prop.setProperty("吉林","长春");
        //根据建获取值
        String value = prop.getProperty("辽宁");
        System.out.println(value);
        //获取键集合
        Set<String> keySet = prop.stringPropertyNames();
        for (String key : keySet) {
            String values = prop.getProperty(key);
            System.out.println(key+" "+values);
        }
    }
}
